# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=icloudbrutter
pkgver=15.1f64f19
pkgrel=9
pkgdesc='Tool for AppleID Bruteforce.'
groups=('blackarch' 'blackarch-cracker')
arch=('any')
url='https://github.com/m4ll0k/iCloudBrutter'
license=('custom:unknown')
depends=('python' 'python-requests' 'python-urllib3')
makedepends=('git')
source=("$pkgname::git+https://github.com/m4ll0k/iCloudBrutter.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" icloud*
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python3 /usr/share/$pkgname/icloud.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

